#!/bin/bash
if [ -e "lock.dat" ]; then
  rm -rf "lock.dat"
  #短时暂停
  sleep 1
else
  #读取s
  s=$(<"$1")
  #s++
  let "s++"
  #更新共享信号量s
  echo "$s" >$1
fi
